<!--
 * @Description: 
 * @Date: 2023-02-20 16:32:27
 * @LastEditors: czp
 * @LastEditTime: 2023-05-09 10:43:32
-->
<template>
	<div class="xiang-su">
		<div class="header">{{ $t("base.n4-name") }}</div>
		<div class="body">
			<!-- <div class="swiper-box">
				<swiper :modules="[Autoplay]" :slides-per-view="2" :space-between="0" :loop="true" :autoplay="true as any">
					<swiper-slide class="swiper-item" v-for="(item, index) in list1" :key="index">
						<el-image fit="cover" :src="item.img + '?imageMogr2/thumbnail/375x'" />
						<span class="mask">{{ item.name }}</span>
					</swiper-slide>
				</swiper>
				<div class="cover-box">
					<span>味鲜肆</span>
					<span>美食地图|百味武隆|精选美食推荐与预定</span>
					<el-image fit="cover" :src="cosPrefix + 'xiangsu/w-title.jpg?imageMogr2/thumbnail/375x'" />
				</div>
			</div>
			<div class="swiper-box">
				<div class="cover-box csj">
					<span>村舍居</span>
					<span>乡宿联盟|归原民宿</span>
					<el-image fit="cover" :src="cosPrefix + 'xiangsu/c-title.png?imageMogr2/thumbnail/375x'" />
				</div>
				<swiper :modules="[Autoplay]" :slides-per-view="2" :space-between="0" :loop="true" :autoplay="{ reverseDirection: true } as any">
					<swiper-slide class="swiper-item" v-for="(item, index) in list2" :key="index">
						<el-image :fit="'cover'" :src="item.img + '?imageMogr2/thumbnail/375x'" />
						<span class="mask">{{ item.name }}</span>
						<span class="tag"> 预定 <IEpArrowRight /> </span>
					</swiper-slide>
				</swiper>
			</div> -->

			<div class="card">
				<div class="title">{{ $t("index.xs.tab1") }}</div>

				<div class="list">
					<JiuDianItem :detail="item" v-for="(item, index) in list" :key="index" />
				</div>
			</div>
			<div class="card">
				<div class="title">{{ $t("index.xs.tab2") }}</div>

				<div class="list">
					<div class="box" v-for="(item, index) in list1" :key="index">
						<el-image :src="item.img" fit="cover" />
						<div class="list-btn">
							<span>{{ item.name }}</span>
						</div>
					</div>
				</div>
				<span class="more" @click="pageJump('/xiang-su/detail')">{{ $t("index.more") }}</span>
			</div>
		</div>
	</div>
</template>
<script setup lang="ts">
// import { Autoplay } from "swiper";
// import { Swiper, SwiperSlide } from "swiper/vue";
import "swiper/css";
import "swiper/css/autoplay";
import { useBaseStore } from "@/store/base";
import { useVR } from "@/hook/useVR";
import { useI18n } from "vue-i18n";
const { pageJump } = useVR();
const { cosPrefix } = useBaseStore();
const i18n = useI18n();
const list = computed(() => [
	{
		name: i18n.t("index.xs.t1-l1"),
		bannerList: [
			cosPrefix + "three-level/xiangsu/guiyuan/jiudiantuijian/fengminggu/1.png",
			cosPrefix + "three-level/xiangsu/guiyuan/jiudiantuijian/fengminggu/2.png",
			cosPrefix + "three-level/xiangsu/guiyuan/jiudiantuijian/fengminggu/3.png",
			cosPrefix + "three-level/xiangsu/guiyuan/jiudiantuijian/fengminggu/4.png"
		],
		href: "http://www.lygyxz.com/listy-21.html"
	}
]);
const list1 = computed(() => [{ name: i18n.t("index.xs.t2-l1"), img: cosPrefix + "three-level/xiangsu/meishigonglue/baiwei/1.png" }]);
// const list1 = [
// 	{ name: "生态火锅", img: cosPrefix + "xiangsu/w1.jpg" },
// 	{ name: "武隆碗碗羊肉", img: cosPrefix + "xiangsu/w2.jpg" },
// 	{ name: "羊角豆干", img: cosPrefix + "xiangsu/w3.jpg" }
// ];
// const list2 = [
// 	{ name: "慢屋民宿", img: cosPrefix + "xiangsu/c1.jpg" },
// 	{ name: "雪漫山", img: cosPrefix + "xiangsu/c2.png" },
// 	{ name: "风鸣谷", img: cosPrefix + "xiangsu/c3.png" }
// ];
</script>
<style lang="scss" scoped>
.xiang-su {
	position: relative;
	z-index: 9;
	&::after {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 1000px;

		// div是你需要添加背景图片的盒子
		content: "";
		background-image: url("https://sms-1302634640.file.myqcloud.com/cloud-jingzhu/bg3.png?imageMogr2/thumbnail/960x'");
		background-repeat: no-repeat;
		background-size: cover;
		opacity: 0.1;
	}
}
.header {
	position: relative;
	z-index: 9;
	padding-top: 60px;
	font-size: 36px;
	font-weight: bold;
	color: rgb(51 51 51 / 100%);
	text-align: center;
}
.body {
	position: relative;
	z-index: 9;
	padding: 40px 0;
	padding-bottom: 0;
	.swiper-box {
		display: flex;
		margin-bottom: 26px;
		&:last-child {
			margin-bottom: 0;
			border-bottom: 0;
		}
		.swiper {
			flex: 1;
			.swiper-item {
				position: relative;
				height: 280px;
				.el-image {
					width: 100%;
					height: 100%;
				}
				.mask {
					position: absolute;
					top: 50%;
					left: 50%;
					display: flex;
					align-items: center;
					justify-content: center;
					width: 296px;
					height: 94px;
					font-family: SourceSerif;
					font-size: 24px;
					font-weight: bold;
					color: #ffffff;
					background-color: rgb(16 16 16 / 60%);
					transform: translate(-50%, -50%);
				}
				.tag {
					position: absolute;
					right: 20px;
					bottom: 20px;
					display: flex;
					align-items: center;
					padding: 6px 8px;
					font-size: 20px;
					color: #ffffff;
					background-color: #8a1313;
					border-radius: 4px;
				}
			}
		}
	}
	.cover-box {
		position: relative;
		display: flex;
		flex-direction: column;
		justify-content: center;
		width: 616px;
		height: 280px;
		padding: 40px;
		padding-left: 0;
		box-shadow: inset 100px 0 16px 0 rgb(0 145 255 / 100%);
		span {
			position: relative;
			z-index: 10;
			font-family: SourceSerif;
			font-size: 30px;
			color: #ffffff;
			text-align: right;
			&:first-child {
				margin-bottom: 10px;
				font-size: 72px;
				font-weight: bold;
			}
		}
		.el-image {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
		}
		&::after {
			position: absolute;
			top: 0;
			left: 0;
			z-index: 9;
			width: 100%;
			height: 100%;
			content: "";
			background: linear-gradient(to left, #c39f63 5%, #aa967441 90%);
			opacity: 1;
		}
		&.csj {
			padding-right: 0;
			padding-left: 40px;
			span {
				text-align: left;
			}
			&::after {
				background: linear-gradient(to right, #c39f63 5%, #aa967441 90%);
			}
		}
	}
}
.box {
	display: flex;
	flex-direction: column;
	align-items: left;
	margin-right: 20px;
	font-size: 20px;
	color: #101010;
	background-color: #ffffff;
	&:last-child {
		margin: 0;
	}
	.el-image {
		width: 100%;
		height: 247px;
		margin-bottom: 20px;
	}
	.list-btn {
		display: flex;
		justify-content: space-between;
		.btn {
			color: #333333;
			text-align: center;
			text-decoration: underline;
		}
	}
}

@media all and (max-width: 750px) {
	.header {
		padding: 0;
		margin-top: 0;
		margin-bottom: 16px;
		font-size: 28px;
	}
	.card {
		flex: 1;
		.title {
			display: flex;
			flex-direction: column;
			align-items: center;
			font-family: SourceSerif;
			font-size: 16px;
			font-weight: bold;
			color: $theme-color;
			border-bottom: 1px solid $theme-color;
			&::after {
				width: 112px;
				height: 6px;
				margin-top: 8px;
				margin-bottom: -3px;
				content: "";
				background-color: $theme-color;
			}
		}
	}
	.body {
		padding: 16px;
		.list {
			width: 100%;
			margin-top: 35px;
		}
		.swiper-box {
			margin-bottom: 10px;
			.swiper {
				flex: 2 !important;
				.swiper-item {
					height: 120px !important;
					.mask {
						width: auto;
						height: auto !important;
						padding: 2px;
						font-size: 10px !important;
					}
					.tag {
						right: 10px;
						bottom: 10px;
						padding: 2px 4px;
						font-size: 8px;
					}
				}
			}
		}
		.cover-box {
			flex: 1;
			width: auto;
			height: 120px;
			span {
				font-size: 12px !important;
			}
		}
	}
}
</style>
